#include<stdio.h>
 
int main()
{
	char a[10];
	
	int i=0,j;
	while (scanf("%c", &a[i])!=EOF && a[i] != '\n')i++;
	printf("%d\n",i);
	for (j = 0; j<i; j++)
		printf("%c ", a[j]);
	printf("\n");
	for (j = i - 1; j >= 0; j--)
		printf("%c", a[j]);
 
	return 0;
 
}
